Many computer systems routinely process sensitive and valuable information. It is important to protect the confidentiality and integrity of computer data from many different security threats. Defending systems from unauthorized physical access and malicious hardware devices is particularly challenging, especially in cloud-computing environments, where users do not have physical control over the hardware which executes their workloads.
U.S. Published Patent Application 2013/0067245, which is hereby incorporated by reference, discloses a software-based cryptoprocessor system that employs cryptographic techniques to provide confidentiality and integrity for an entire system, including both user-mode applications and privileged system software. With this cryptoprocessor, only the main processor is trusted to operate according to its specifications, and other system hardware is considered untrusted and potentially malicious. Data (including code) is available as cleartext only within the processor cache, but remains encrypted in main memory. Techniques such as authenticated, encrypted demand paging can be used to transfer data securely between main memory and the processor cache. As one example, an encryption agent is installed to be resident in the cache, functionally between the main processor and memory, so as to encrypt data/code that is written to memory and to decrypt it before it is passed from memory to the processor. In effect, the cryptoprocessor system treats the processor cache like main memory in a conventional system, and it treats main memory like a conventional backing store on disk or other secondary storage.
It is challenging for a software-based cryptoprocessor system to achieve high performance while providing secure execution. For example, performance can be degraded as a result of increased memory pressure, due to the relatively small amount of cache space serving as “main memory”. For example, while a modern Intel x86 processor contains tens of megabytes of cache memory, typical systems using such processors are configured with tens of gigabytes of RAM used as main memory-roughly a thousand times larger than the cache. If the amount of memory needed by a workload over some time period, known as its “working set”, exceeds the cache size, this can result in significant overhead, due to encrypted paging of data between the small trusted memory (cache) and the large untrusted backing store (RAM). A substantial fraction of this overhead may be incurred by the cryptographic operations that must be performed during each transfer of data. In other words, the general goal of a cache is to increase execution speed, but the space in the cache-regardless of how many levels it includes-will almost always be much smaller that the address space of the memory that ne may wish to be able to cache; however, the time it takes to swap lines between the cache and memory may therefore partially or totally negate the speed advantage the cache is intended to provide.